package com.huas.mapper;

import com.github.pagehelper.Page;
import com.huas.dto.TalkDTO;
import com.huas.entity.Talk;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface TalkMapper {

    Page<Talk> page(Integer status);

    /**
     * 使主键从当前最大的值开始自增（可以解决部分自增不连续问题）
     */
    @Update("ALTER TABLE user AUTO_INCREMENT = 1")
    void reset();

    void insert(Talk talk);

    void update(Talk talk);

    @Delete("delete from talk where id = #{id}")
    void delete(Integer id);

    void deleteBatch(List<Integer> ids);

    List<Talk> selectTalkList();
}
